using UnityEngine;

public class WinDialogUI : MonoBehaviour
{
	public delegate void OnFinishDelegate();

	public UILabel scoreText;

	public UILabel coinsText;

	public UILabel ranksText;

	public UILabel bodyText;

	public GameObject window;

	public event OnFinishDelegate onFinish;

	public void showWinDialog(string text, int scoreVal, int coinsVal, float startValue, float endValue, OnFinishDelegate onFin)
	{
		scoreText.text = "Score: " + scoreVal;
		coinsText.text = "Coins: " + coinsVal;
		ranksText.text = "Level progress: " + startValue + " -> " + endValue;
		bodyText.text = text;
		window.SetActive(true);
		if (onFin != null)
		{
			onFinish += delegate
			{
				onFin();
			};
		}
	}

	public void hideWinDialog()
	{
		window.SetActive(false);
	}

	public void OnCancel()
	{
	}

	public void OnOk()
	{
		this.onFinish();
	}
}
